#include <stdio.h>
struct complex
{
	int real;
	int image;
};
struct complex multiply(struct complex x, struct complex y);
int mian()
{
	struct complex product, x, y;
	scanf_s("%d%d%d%d", &x.real, &x.image, &y.real, &y.image);
	product = multiply(x, y);
	printf("(%d+%di)*(%d+%di)", x.real, x.image, y.real, y.image);
	printf("%d+%di", product.real, product.image);
	return 0;
}
struct complex multiply(struct complex x,struct complex y)
{
	struct complex co;
	co.real = (x.real * y.image - x.image * y.real);
	co.image = (x.real * x.image + y.real * y.image);
	return co;
};

